<template>
  <Form
    ref="formInline"
    :model="formInline"
    inline
  >
    <FormItem
      :key="i"
      v-for="(item,i) in form"
    >
      <Input
        style="min-width:100px"
        v-if="item.type=='input'"
        v-model="formInline[item.label]"
        :placeholder="item.placeholder"
      ></Input>
      <Select
        v-else-if="item.type === 'select'"
        style="min-width:100px"
        v-model="formInline[item.label]"
      >
        <Option
          :key="index"
          v-for="(ite,index) in item.options"
          :value="ite.id"
        >{{ite.title}}</Option>
      </Select>
    </FormItem>
    <FormItem>
      <Button
        type="primary"
        @click="handleSubmit('formInline')"
      >搜索</Button>
    </FormItem>
  </Form>
</template>
<script>
export default {
  props: ["form"],
  data() {
    return {
      formInline: {}
    };
  },
  methods: {
    handleSubmit(name) {
      this.$emit("on-click", this.formInline);
    }
  }
};
</script>
